//接口层

//引入axios,js
import axios from '@/utils/axios.js';

//商品分类结构
export const reqGoodsList = (params) => {
    return axios({
        url: '/goods/catelist', //请求地址
        method: 'get', //请求方式
        params
    })
}

//添加商品分类
export const reqAddCate = (data) => {
    return axios({
        url: '/goods/addcate',
        method: 'post',
        data
    })
}

//删除商品列表
export const reqDelCate = (params) => {
    return axios({
        url: '/goods/delcate',
        method: 'get',
        params
    })
}

//修改商品分类
export const reqEditCate = (data) => {
    return axios({
        url: '/goods/editcate',
        method: 'post',
        data
    })
}

//查询所有启用的分类名称
export const reqCateGories = (params) => {
    return axios({
        url: '/goods/categories',
        method: 'get',
        params
    })
}

//添加商品
export const reqAdd = (data) => {
    return axios({
        url: '/goods/add',
        method: 'post',
        data
    })
}

//获取商品列表
export const reqList = (params) => {
    return axios({
        url: '/goods/list',
        method: 'get',
        params
    })
}

//删除商品列表
export const reqDel = (params) => {
    return axios({
        url: '/goods/del',
        method: 'get',
        params
    })
}

//保存修改信息
export const reqEdit = (data) => {
    return axios({
        url: '/goods/edit',
        method: 'post',
        data
    })
}